package edu.hut.mpdemo.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

//只展示接口使用说明，不能使用该控制器
@RestController
@Api(value = "电影Controller", tags = {"电影访问接口"})
public class SwaggerController {
    @PostMapping("/addFilm")
    @ApiOperation(value = "addFilm")
    @ApiResponses(value = {
            @ApiResponse(code = 1000, message = "成功"),
            @ApiResponse(code = 1001, message = "失败"),
//            @ApiResponse(code = 1002, response = Film.class, message = "缺少参数")
    })
    public void addFilm(@ApiParam("电影名称") @RequestParam("filmName") String filmName,
                        @ApiParam(value = "分数", allowEmptyValue = true) @RequestParam("score") Short score,
                        @ApiParam("发布时间") @RequestParam(value = "publishTime", required = false) String publishTime,
                        @ApiParam("创建者id") @RequestParam("creatorId") Long creatorId) {

    }
}